package de.app.fbc.user

import javax.jdo.annotations.*;
import com.google.appengine.api.datastore.Key;

@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true")
class User implements Serializable {

    static transients = ['isAdmin']
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    Key key
    
    @Persistent
    String loginName

    @Persistent
    String passwort

    @Persistent
    String email

    @Persistent
    String vorname

    @Persistent
    String nachname

    @Persistent
    String strasse

    @Persistent
    String plz

    @Persistent
    String ort
    
    static constraints = {
    	id(visible:false)
        vorname(nullable: true, blank: true)
        plz(nullable: true, blank: true)
        ort(nullable: true, blank: true)
        strasse(nullable: true, blank: true)
        loginName(nullable: false, blank: false)
        passwort(nullable: false, blank: false)
        email(nullable: false, blank: false)
        nachname(nullable: false, blank: false)
	}
        public String toString()
        {
            return this.vorname;
        }
}
